<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>pg_depend</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REV="MADE"
HREF="mailto:pgsql-docs@postgresql.org"><LINK
REL="HOME"
TITLE="PostgreSQL 9.1.2 Documentation"
HREF="index.html"><LINK
REL="UP"
TITLE="System Catalogs"
HREF="catalogs.html"><LINK
REL="PREVIOUS"
TITLE="pg_default_acl"
HREF="catalog-pg-default-acl.html"><LINK
REL="NEXT"
TITLE="pg_description"
HREF="catalog-pg-description.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="stylesheet.css"><META
HTTP-EQUIV="Content-Type"
CONTENT="text/html; charset=ISO-8859-1"><META
NAME="creation"
CONTENT="2011-12-01T22:07:59"></HEAD
><BODY
CLASS="SECT1"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="5"
ALIGN="center"
VALIGN="bottom"
><A
HREF="index.html"
>PostgreSQL 9.1.2 Documentation</A
></TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
TITLE="pg_default_acl"
HREF="catalog-pg-default-acl.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="top"
><A
HREF="catalogs.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="60%"
ALIGN="center"
VALIGN="bottom"
>Chapter 45. System Catalogs</TD
><TD
WIDTH="20%"
ALIGN="right"
VALIGN="top"
><A
TITLE="pg_description"
HREF="catalog-pg-description.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="CATALOG-PG-DEPEND"
>45.18. <TT
CLASS="STRUCTNAME"
>pg_depend</TT
></A
></H1
><P
>   The catalog <TT
CLASS="STRUCTNAME"
>pg_depend</TT
> records the dependency
   relationships between database objects.  This information allows
   <TT
CLASS="COMMAND"
>DROP</TT
> commands to find which other objects must be dropped
   by <TT
CLASS="COMMAND"
>DROP CASCADE</TT
> or prevent dropping in the <TT
CLASS="COMMAND"
>DROP
   RESTRICT</TT
> case.
  </P
><P
>   See also <A
HREF="catalog-pg-shdepend.html"
><TT
CLASS="STRUCTNAME"
>pg_shdepend</TT
></A
>,
   which performs a similar function for dependencies involving objects
   that are shared across a database cluster.
  </P
><DIV
CLASS="TABLE"
><A
NAME="AEN86393"
></A
><P
><B
>Table 45-18. <TT
CLASS="STRUCTNAME"
>pg_depend</TT
> Columns</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><COL><COL><COL><THEAD
><TR
><TH
>Name</TH
><TH
>Type</TH
><TH
>References</TH
><TH
>Description</TH
></TR
></THEAD
><TBODY
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>classid</TT
></TD
><TD
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
><TT
CLASS="LITERAL"
><A
HREF="catalog-pg-class.html"
><TT
CLASS="STRUCTNAME"
>pg_class</TT
></A
>.oid</TT
></TD
><TD
>The OID of the system catalog the dependent object is in</TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>objid</TT
></TD
><TD
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
>any OID column</TD
><TD
>The OID of the specific dependent object</TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>objsubid</TT
></TD
><TD
><TT
CLASS="TYPE"
>int4</TT
></TD
><TD
>&nbsp;</TD
><TD
>       For a table column, this is the column number (the
       <TT
CLASS="STRUCTFIELD"
>objid</TT
> and <TT
CLASS="STRUCTFIELD"
>classid</TT
> refer to the
       table itself).  For all other object types, this column is
       zero.
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>refclassid</TT
></TD
><TD
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
><TT
CLASS="LITERAL"
><A
HREF="catalog-pg-class.html"
><TT
CLASS="STRUCTNAME"
>pg_class</TT
></A
>.oid</TT
></TD
><TD
>The OID of the system catalog the referenced object is in</TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>refobjid</TT
></TD
><TD
><TT
CLASS="TYPE"
>oid</TT
></TD
><TD
>any OID column</TD
><TD
>The OID of the specific referenced object</TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>refobjsubid</TT
></TD
><TD
><TT
CLASS="TYPE"
>int4</TT
></TD
><TD
>&nbsp;</TD
><TD
>       For a table column, this is the column number (the
       <TT
CLASS="STRUCTFIELD"
>refobjid</TT
> and <TT
CLASS="STRUCTFIELD"
>refclassid</TT
> refer
       to the table itself).  For all other object types, this column
       is zero.
      </TD
></TR
><TR
><TD
><TT
CLASS="STRUCTFIELD"
>deptype</TT
></TD
><TD
><TT
CLASS="TYPE"
>char</TT
></TD
><TD
>&nbsp;</TD
><TD
>       A code defining the specific semantics of this dependency relationship; see text
      </TD
></TR
></TBODY
></TABLE
></DIV
><P
>   In all cases, a <TT
CLASS="STRUCTNAME"
>pg_depend</TT
> entry indicates that the
   referenced object cannot be dropped without also dropping the dependent
   object.  However, there are several subflavors identified by
   <TT
CLASS="STRUCTFIELD"
>deptype</TT
>:

   <P
></P
></P><DIV
CLASS="VARIABLELIST"
><DL
><DT
><TT
CLASS="SYMBOL"
>DEPENDENCY_NORMAL</TT
> (<TT
CLASS="LITERAL"
>n</TT
>)</DT
><DD
><P
>       A normal relationship between separately-created objects.  The
       dependent object can be dropped without affecting the
       referenced object.  The referenced object can only be dropped
       by specifying <TT
CLASS="LITERAL"
>CASCADE</TT
>, in which case the dependent
       object is dropped, too.  Example: a table column has a normal
       dependency on its data type.
      </P
></DD
><DT
><TT
CLASS="SYMBOL"
>DEPENDENCY_AUTO</TT
> (<TT
CLASS="LITERAL"
>a</TT
>)</DT
><DD
><P
>       The dependent object can be dropped separately from the
       referenced object, and should be automatically dropped
       (regardless of <TT
CLASS="LITERAL"
>RESTRICT</TT
> or <TT
CLASS="LITERAL"
>CASCADE</TT
>
       mode) if the referenced object is dropped.  Example: a named
       constraint on a table is made autodependent on the table, so
       that it will go away if the table is dropped.
      </P
></DD
><DT
><TT
CLASS="SYMBOL"
>DEPENDENCY_INTERNAL</TT
> (<TT
CLASS="LITERAL"
>i</TT
>)</DT
><DD
><P
>       The dependent object was created as part of creation of the
       referenced object, and is really just a part of its internal
       implementation.  A <TT
CLASS="COMMAND"
>DROP</TT
> of the dependent object
       will be disallowed outright (we'll tell the user to issue a
       <TT
CLASS="COMMAND"
>DROP</TT
> against the referenced object, instead).  A
       <TT
CLASS="COMMAND"
>DROP</TT
> of the referenced object will be propagated
       through to drop the dependent object whether
       <TT
CLASS="COMMAND"
>CASCADE</TT
> is specified or not.  Example: a trigger
       that's created to enforce a foreign-key constraint is made
       internally dependent on the constraint's
       <TT
CLASS="STRUCTNAME"
>pg_constraint</TT
> entry.
      </P
></DD
><DT
><TT
CLASS="SYMBOL"
>DEPENDENCY_EXTENSION</TT
> (<TT
CLASS="LITERAL"
>e</TT
>)</DT
><DD
><P
>       The dependent object is a member of the <I
CLASS="FIRSTTERM"
>extension</I
> that is
       the referenced object (see
       <A
HREF="catalog-pg-extension.html"
><TT
CLASS="STRUCTNAME"
>pg_extension</TT
></A
>).
       The dependent object can be dropped only via
       <TT
CLASS="COMMAND"
>DROP EXTENSION</TT
> on the referenced object.  Functionally
       this dependency type acts the same as an internal dependency, but
       it's kept separate for clarity and to simplify <SPAN
CLASS="APPLICATION"
>pg_dump</SPAN
>.
      </P
></DD
><DT
><TT
CLASS="SYMBOL"
>DEPENDENCY_PIN</TT
> (<TT
CLASS="LITERAL"
>p</TT
>)</DT
><DD
><P
>       There is no dependent object; this type of entry is a signal
       that the system itself depends on the referenced object, and so
       that object must never be deleted.  Entries of this type are
       created only by <TT
CLASS="COMMAND"
>initdb</TT
>.  The columns for the
       dependent object contain zeroes.
      </P
></DD
></DL
></DIV
><P>

   Other dependency flavors might be needed in future.
  </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="catalog-pg-default-acl.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="catalog-pg-description.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><TT
CLASS="STRUCTNAME"
>pg_default_acl</TT
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="catalogs.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><TT
CLASS="STRUCTNAME"
>pg_description</TT
></TD
></TR
></TABLE
></DIV
></BODY
></HTML
>